<template>
  <div class="pages">
    <el-pagination
      background
      layout="total,prev, pager, next,jumper"
      :total="total"
      :page-size="pageSize"
      :current-page="currentPage"
      @current-change="changePages"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 100,
    },
    pageSize: {
      type: Number,
      default: 10,
    },
    currentPage: {
      type: Number,
      default: 1,
    },
  },
  computed: {
    local_currentPage() {
      return this.currentPage;
    },
  },
  methods: {
    //自定义事件，后面调用时必须使用@changePages
    changePages(page) {
      this.$emit("changePages", page);
    },
  },
};
</script>

<style lang='less' scoped>
.pages {
  text-align: center;
  margin: 20px;
}
</style>